Skip to content

feat(@schematics/angular): stabilize refactor-jasmine-vitest schematic#32874

Merged
clydin merged 1 commit into
angular:mainfrom
hawkgs:refactor-jasmine-vitest-stable
Apr 14, 2026
Merged

feat(@schematics/angular): stabilize refactor-jasmine-vitest schematic#32874
clydin merged 1 commit into
angular:mainfrom
hawkgs:refactor-jasmine-vitest-stable

Conversation

@hawkgs

@hawkgs hawkgs commented Mar 27, 2026

Copy link
Copy Markdown
Member

Stabilize refactor-jasmine-vitest schematic by covering the known remaining test patterns and cases.

The current state of the schematic covers the most common and used test patterns. This PR adds rather peripheral API to the list of supported transformations. Most of these do not have a Vitest equivalent.

API State
jasmine.createSpy('withName') ✅ Added support
spy.calls.thisFor(index) ✅ Added support
spy.calls.saveArgumentsByValue() 🚧 Not supported; Comment added
spy.and.identity() ✅ Added support
.and.returnValue(Promise.resolve(x)) / .and.returnValue(Promise.reject(x)) ✅ Added support
fail(new Error()) ✅ Added support
jasmine.clock().withMock() 🚧 Not supported; Comment added
jasmine.clock().autoTick() 🚧 Not supported; Comment added
jasmine.addAsyncMatchers() 🚧 Not supported; Comment added
jasmine.addSpyStrategy() 🚧 Not supported; Comment added
jasmine.addCustomObjectFormatter() 🚧 Not supported; Comment added
toBeNullish() ✅ Added support
throwUnless() / throwUnlessAsync() 🚧 Not supported; Comment added
getSpecProperty() 🚧 Not supported; Comment added
jasmine.MAX_PRETTY_PRINT_DEPTH / MAX_PRETTY_PRINT_CHARS / MAX_PRETTY_PRINT_ARRAY_LENGTH 🚧 Not supported; Comment added

@angular-robot angular-robot Bot added the detected: feature PR contains a feature commit label Mar 27, 2026
@hawkgs hawkgs force-pushed the refactor-jasmine-vitest-stable branch 2 times, most recently from 48214dd to fe6dcba Compare April 6, 2026 11:23
@hawkgs hawkgs marked this pull request as ready for review April 6, 2026 11:23
@hawkgs hawkgs requested review from alan-agius4 and clydin April 6, 2026 11:23

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request expands the Jasmine to Vitest migration schematics by adding support for several Jasmine APIs, including toBeNullish, createSpy, and various spy strategies. It also introduces TODO comments for unsupported Jasmine features and improves existing transformations for fail() and spy call inspections. Feedback was provided to improve the toBeNullish transformation by using loose equality to avoid double evaluation of expressions with side effects, and to use the TypeScript factory API for numeric literals in transformThisFor for better consistency.

Comment thread packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy.ts Outdated
Stabilize `refactor-jasmine-vitest` schematic by covering the known remaining test patterns and cases.
@hawkgs hawkgs force-pushed the refactor-jasmine-vitest-stable branch from fe6dcba to c742ac9 Compare April 6, 2026 12:29
@alan-agius4 alan-agius4 removed their request for review April 13, 2026 15:11
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Apr 13, 2026
@clydin clydin merged commit de630c2 into angular:main Apr 14, 2026
64 of 65 checks passed
@clydin

clydin commented Apr 14, 2026

Copy link
Copy Markdown
Member

This PR was merged into the repository. The changes were merged into the following branches:

@hawkgs hawkgs deleted the refactor-jasmine-vitest-stable branch April 14, 2026 15:16
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: @schematics/angular detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants